import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class AppInfo {
  final String appName = "小黑视频";
  final String version = "1.0.0";
  final String developer = "Alan Smith";
}

class Configs {
  static String token = "";

  // 阿里云oss相关参数
  static String accessKeyId = '';
  static String accessKeySecret = '';
  static String bucketName = '';
  static String endpoint = '';
  static String securityToken = '';

  // 字体相关
  static double smallTipSize_8 = 8.sp; //超级小提示文本
  static double tipSize_10 = 10.sp; //按钮文本
  static double textSize_12 = 12.sp; //普通文本
  static double titleSize_14 = 14.sp; //普通标题
  static double lgTitleSize_16 = 16.sp; //最大标题

  // 间距
  static double padding_10 = 10.0; // 较小的间距或者内部间距
  static double padding_15 = 15.0; // 组件标准距离
  // app 信息
  static final app = AppInfo();

  // 获取baseUrl
  static Configs? _instance; //设置单例模式
  late String _baseUrl; //api接口地址
  String get getBaseUrl => _baseUrl;
  static const String _imgUrl = "www.img.com"; //图片地址
  String get getImgUrl => _imgUrl;

  Configs._();
  // 静态方法，用于获取单例实例
  static Configs get instance {
    if (_instance == null) {
      _instance = Configs._();
      // 根据构建模式初始化 baseUrl
      if (const bool.fromEnvironment('dart.vm.product')) {
        // 生产环境（release 模式）
        _instance!._baseUrl = 'www.pro.com';
      } else {
        // 开发环境（debug 模式）
        _instance!._baseUrl = 'http://192.168.0.106:8888';
      }
    }
    return _instance!;
  }
}

// 生成全局唯一键
class Global {
  static GlobalKey<NavigatorState> navigatorKey = GlobalKey();
}
